package netudp3;

import javax.sound.sampled.Port;

public class ChatRoom implements Runnable{
	
	private String ip ;
	private int serverPort;
	private int localPort;
	
	public ChatRoom(String ip, int serverPort, int localPort) {
		super();
		this.ip = ip;
		this.serverPort = serverPort;
		this.localPort = localPort;
	}

	@Override
	public void run() {
		UDPClient uc = new UDPClient(ip, serverPort);
		UDPServer us = new UDPServer(localPort);
		Thread thread = new Thread(uc);
		Thread thread2 = new Thread(us);
		thread.start();
		thread2.start();
		
	}

}
